import axiosIns from '@/plugins/axios';

// 获取咨询师负责的学生列表
export async function getMyStudents(consultantId: number) {
  const options = {
    method: 'GET',
    url: `/api/consultant/students`,
    params: { consultantId },
    headers: {
      'Content-Type': 'application/json'
    }
  };
  return axiosIns.request(options);
}

// 获取学生的咨询记录
export async function getStudentRecords(appointmentId: number) {
  const options = {
    method: 'GET',
    url: `/api/consultant/records`,
    params: { appointmentId },
    headers: {
      'Content-Type': 'application/json'
    }
  };
  return axiosIns.request(options);
}

// 提交咨询记录
export async function submitConsultRecord(recordData: {
  appointment_id: number;
  visitor_id: number;
  visit_time: string;
  risk_level: string;
  problem_type: string;
  conclusion: string;
  note?: string;
}) {
  const options = {
    method: 'POST',
    url: `/api/consultant/submit-record`,
    data: recordData,
    headers: {
      'Content-Type': 'application/json'
    }
  };
  return axiosIns.request(options);
}

// 提前结案
export async function closeCase(closeData: {
  appointment_id: number;
  visitor_id: number;
  close_reason: string;
}) {
  const options = {
    method: 'POST',
    url: `/api/consultant/close-case`,
    data: closeData,
    headers: {
      'Content-Type': 'application/json'
    }
  };
  return axiosIns.request(options);
} 